<template>
  <el-table :data="tableData" style="width: 100%" border>
    <el-table-column fixed prop="userName" label="姓名\请假月份" width="150" />

    <!-- <el-table-column v-for="(mouth, index) in 12" :key="index" :label='${ index + 1 }' width="100">
      <template #default="scope">
          <el-button @click="getming(scope.row.uid,index+1)" link v-if="scope.row.moths[index]>0" style="color: red;text-decoration: underline; ">{{scope.row.moths[index] }}</el-button>
          <span v-else>{{scope.row.moths[index] }}</span>
      </template>
    </el-table-column> -->
  </el-table>
</template>

<script lang="ts" setup>
import axios from 'axios';
import { onMounted, ref } from 'vue';

const handleClick = () => {
  console.log('click')
}

const tableData =ref([{
  "userId": 0,
      "userName": "",
      "monthlyHours": []
}])
const year=ref(new Date().getFullYear())  
const getData=()=>{
  axios.get("http://localhost:5011/api/Report/GetLeaveSummary",{params:{Year:year.value}}).then(res=>{
    tableData.value=res.data.data
  })
}
onMounted(()=>{
  getData();
})
</script>
